package com.sdry.product.sorting.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sdry.product.sorting.entity.SortReceivingDetail;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author chenBin
 */
public interface SortReceivingDetailMapper extends BaseMapper<SortReceivingDetail> {
    /**
     * 分页查询
     * @param sortReceivingDetail 收货详细
     * @return List<SortReceivingDetail>
     */
    List<SortReceivingDetail> queryWarehousingDetailPage(SortReceivingDetail sortReceivingDetail);

    /**
     * 总数
     * @param sortReceivingDetail 收货详细
     * @return Long
     */
    Long queryWarehousingDetailTotal(SortReceivingDetail sortReceivingDetail);

    /**
     * 更改容器装载数量
     * @param psId 容器ID
     * @param maId 物料ID
     * @param quantity
     * @param userId
     * @param remark2
     * @return  Integer
     */
    Integer updateContainerStareQuantity(@Param("psId") String psId, @Param("maId") Long maId, @Param("quantity") Long quantity, @Param("userId") String userId, @Param("remark2") String remark2);

    /**
     * 更改指令单状态-tostare -- 2已收货
     * @param toId 指令单ID
     * @param userId
     * @return  Integer
     */
    Integer updateTransitOrderStatus(@Param("toId") String toId, @Param("userId") String userId);

    /**
     * 删除容器装载
     * @param psId 容器ID
     * @param maId 物料ID
     * @return  Integer
     */
    Integer deleteContainerStareQuantity(@Param("psId") String psId, @Param("maId") Long maId);
    /**
     * 删除容器装载
     * @param psId 容器ID
     * @return  Integer
     */
    Integer deleteContainerStareQuantity2(Long psId);

    /**
     * 容器装载表
     * @param containerIdLong 容器ID
     * @param userId 用户ID
     * @param wriId 库位
     * @return  Integer
     */
    Integer updateContainerStareStatus(@Param("containerIdLong") Long containerIdLong, @Param("userId") String userId, @Param("wriId") long wriId);

    /**
     * /更改容器装载数量
     * @param psId 容器ID
     * @param maId 物料ID
     * @param quantity 数量
     * @param userId 用户ID
     * @return  Integer
     */
    Integer updateContainerStareQuantity3(@Param("psId") String psId, @Param("maId") Long maId, @Param("quantity") Long quantity, @Param("userId") String userId);


    /**
     * //更改容器装载记录表状态
     * @param psId 容器ID
     * @param maId 物料ID
     * @return  Integer
     */
    Integer updateTransitOrderRecordStatus(@Param("psId") String psId, @Param("maId") Long maId);

    /**
     * 查询物料数量
     * @param psId 容器ID
     * @param maId 物料ID
     * @return
     */
    Long queryContainerStareQuantity(@Param("psId") String psId, @Param("maId") Long maId);
}
